<!DOCTYPE html>
<html lang="en">
<head>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>
</head>
<body>
    <div id="app">
        <button-counter></button-counter>
        <button-counter></button-counter>
        <button-counter></button-counter>
    </div>
    <script>
        Vue.component('button-counter',{
            data:function(){
                return{
                    count:0
                }
            },
            template:'<button v-on:click="count++">你单击了{{count}}次</button>'
        }),
        new Vue({
            el:'#app',
        })
    </script>
</body>
</html>